object fraAddress: TfraAddress
  Left = 0
  Top = 0
  Width = 258
  Height = 201
  TabOrder = 0
  object SearchBox: TGroupBox
    Left = 0
    Top = 0
    Width = 258
    Height = 201
    Align = alClient
    Caption = ' '#1042#1099#1073#1086#1088' '#1072#1076#1088#1077#1089#1072' '
    Constraints.MinHeight = 200
    Constraints.MinWidth = 258
    TabOrder = 0
    object Label6: TLabel
      Left = 30
      Top = 26
      Width = 69
      Height = 13
      Caption = #1051#1080#1094#1077#1074#1086#1081' '#1089#1095#1077#1090
    end
    object Label1: TLabel
      Left = 48
      Top = 75
      Width = 51
      Height = 13
      Caption = #1053#1072#1089'.'#1087#1091#1085#1082#1090
    end
    object Label2: TLabel
      Left = 67
      Top = 99
      Width = 32
      Height = 13
      Caption = #1059#1083#1080#1094#1072
    end
    object Label3: TLabel
      Left = 76
      Top = 123
      Width = 23
      Height = 13
      Caption = #1044#1086#1084
    end
    object Label4: TLabel
      Left = 51
      Top = 147
      Width = 48
      Height = 13
      Caption = #1050#1074#1072#1088#1090#1080#1088#1072
    end
    object Label5: TLabel
      Left = 72
      Top = 51
      Width = 27
      Height = 13
      Caption = #1060#1048#1054
    end
    object FindBtn: TButton
      Left = 8
      Top = 168
      Width = 75
      Height = 25
      Caption = #1048#1089#1082#1072#1090#1100
      TabOrder = 6
    end
    object ClearBtn: TButton
      Left = 88
      Top = 168
      Width = 75
      Height = 25
      Caption = #1054#1095#1080#1089#1090#1080#1090#1100
      TabOrder = 7
      OnClick = ClearBtnClick
    end
    object AddBtn: TButton
      Left = 168
      Top = 168
      Width = 83
      Height = 25
      Caption = #1056#1072#1089#1096#1080#1088#1077#1085#1085#1099#1081
      TabOrder = 8
    end
    object TownBox: TDBLookupComboboxEh
      Left = 104
      Top = 72
      Width = 146
      Height = 19
      EditButtons = <>
      Flat = True
      KeyField = 'CODE'
      ListField = 'NAME'
      ListFieldIndex = -1
      ListSource = ds_QTowns
      TabOrder = 2
      Visible = True
      OnChange = TownBoxChange
      OnCloseUp = TownBoxCloseUp
      OnEnter = TownBoxEnter
      OnKeyPress = TownBoxKeyPress
    end
    object StreetBox: TDBLookupComboboxEh
      Left = 104
      Top = 96
      Width = 146
      Height = 19
      EditButtons = <>
      Flat = True
      KeyField = 'CODE'
      ListField = 'STREET'
      ListFieldIndex = -1
      ListSource = ds_QStreets
      TabOrder = 3
      Visible = True
      OnChange = StreetBoxChange
      OnCloseUp = TownBoxCloseUp
      OnEnter = TownBoxEnter
      OnKeyPress = TownBoxKeyPress
    end
    object HouseBox: TDBLookupComboboxEh
      Left = 104
      Top = 120
      Width = 146
      Height = 19
      EditButtons = <>
      Flat = True
      KeyField = 'ID'
      ListField = 'NUM'
      ListFieldIndex = -1
      ListSource = ds_QHouses
      TabOrder = 4
      Visible = True
      OnChange = HouseBoxChange
      OnCloseUp = TownBoxCloseUp
      OnEnter = TownBoxEnter
      OnKeyPress = TownBoxKeyPress
    end
    object AppartBox: TDBLookupComboboxEh
      Left = 104
      Top = 144
      Width = 146
      Height = 19
      EditButtons = <>
      Flat = True
      KeyField = 'ID'
      ListField = 'NUM'
      ListFieldIndex = -1
      ListSource = ds_QApparts
      TabOrder = 5
      Visible = True
      OnCloseUp = TownBoxCloseUp
      OnEnter = TownBoxEnter
      OnKeyPress = TownBoxKeyPress
    end
    object NLSEdit: TDBEditEh
      Left = 104
      Top = 24
      Width = 146
      Height = 19
      AlwaysShowBorder = True
      EditButtons = <>
      Flat = True
      TabOrder = 0
      Visible = True
      OnExit = NLSEditExit
      OnKeyPress = TownBoxKeyPress
    end
    object NameEdit: TDBEditEh
      Left = 104
      Top = 48
      Width = 146
      Height = 19
      AlwaysShowBorder = True
      EditButtons = <>
      Flat = True
      TabOrder = 1
      Visible = True
      OnKeyPress = TownBoxKeyPress
    end
  end
  object QStreets: TpFIBDataSet
    SelectSQL.Strings = (
      
        'select cast(-1 as integer) as code, cast('#39' ---- '#39' as varchar(120' +
        ')) as street'
      '  from rdb$database'
      'union'
      'select s.code, s.street'
      '  from vw_streets s'
      '  where s.town_id = :ptown_id'
      '  order by 2')
    CSMonitorSupport.Enabled = csmeTransactionDriven
    Left = 150
    Top = 44
    oFetchAll = True
    object QStreetsCODE: TFIBIntegerField
      FieldName = 'CODE'
    end
    object QStreetsSTREET: TFIBStringField
      FieldName = 'STREET'
      Size = 120
      EmptyStrToNull = True
    end
  end
  object QHouses: TpFIBDataSet
    SelectSQL.Strings = (
      
        'select cast(-1 as integer) as id, cast('#39' ---- '#39' as varchar(22)) ' +
        'as num, cast('#39#39' as varchar(16)) as house, cast(null as varchar(3' +
        ')) as corps'
      '  from rdb$database'
      'union'
      'select v.id, v.num, v.house, v.corps'
      '  from vw_buildings v'
      '  where v.street_id = :pstreet_id'
      '  order by 3,4')
    CSMonitorSupport.Enabled = csmeTransactionDriven
    Left = 150
    Top = 76
    oFetchAll = True
    object QHousesID: TFIBIntegerField
      FieldName = 'ID'
    end
    object QHousesNUM: TFIBStringField
      FieldName = 'NUM'
      Size = 22
      EmptyStrToNull = True
    end
    object QHousesHOUSE: TFIBStringField
      FieldName = 'HOUSE'
      Size = 16
      EmptyStrToNull = True
    end
    object QHousesCORPS: TFIBStringField
      FieldName = 'CORPS'
      Size = 3
      EmptyStrToNull = True
    end
  end
  object QTowns: TpFIBDataSet
    SelectSQL.Strings = (
      'select'
      '    code,'
      '    name,'
      '    full_name'
      'from vw_towns '
      'where local = 1'
      'order by name')
    CSMonitorSupport.Enabled = csmeTransactionDriven
    Left = 150
    Top = 12
    oFetchAll = True
    object QTownsNAME: TFIBStringField
      FieldName = 'NAME'
      Size = 60
      EmptyStrToNull = True
    end
    object QTownsCODE: TFIBIntegerField
      FieldName = 'CODE'
    end
    object QTownsFULL_NAME: TFIBStringField
      FieldName = 'FULL_NAME'
      Size = 123
      EmptyStrToNull = True
    end
  end
  object QApparts: TpFIBDataSet
    SelectSQL.Strings = (
      
        'select cast(0 as integer) as id, cast('#39' ---- '#39' as varchar(15)) a' +
        's num, '
      
        '       cast(-1 as integer) as apparts, cast(null as varchar(3)) ' +
        'as letter, '
      '       0 as acnt'
      '  from rdb$database'
      'union'
      'select max(v.id), v.num, v.apparts, v.letter, count(1) as acnt'
      '  from vw_abonents v'
      '  where v.building_id = :pbuilding_id'
      
        '    and not exists(select first(1) 1 from abonents a1 where a1.s' +
        'uper_abonent = v.id)'
      '    and v.super_abonent > 0'
      '--    and v.is_active = 1'
      '  group by 2,3,4'
      '  order by 3,4')
    Transaction = MAINDM.pMainTransaction
    Database = MAINDM.pMainDatabase
    CSMonitorSupport.Enabled = csmeTransactionDriven
    Left = 150
    Top = 108
    oFetchAll = True
    object QAppartsID: TFIBIntegerField
      FieldName = 'ID'
    end
    object QAppartsNUM: TFIBStringField
      FieldName = 'NUM'
      Size = 15
      EmptyStrToNull = True
    end
    object QAppartsAPPARTS: TFIBIntegerField
      FieldName = 'APPARTS'
    end
    object QAppartsLETTER: TFIBStringField
      FieldName = 'LETTER'
      Size = 3
      EmptyStrToNull = True
    end
    object QAppartsACNT: TFIBIntegerField
      FieldName = 'ACNT'
    end
  end
  object ds_QTowns: TDataSource
    DataSet = QTowns
    Left = 186
    Top = 12
  end
  object ds_QApparts: TDataSource
    DataSet = QApparts
    Left = 186
    Top = 108
  end
  object ds_QHouses: TDataSource
    DataSet = QHouses
    Left = 186
    Top = 76
  end
  object ds_QStreets: TDataSource
    DataSet = QStreets
    Left = 186
    Top = 44
  end
end
